<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/core/pbuf.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('pbuf_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">pbuf.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pbuf_8h.html">lwip/pbuf.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stats_8h.html">lwip/stats.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="def_8h.html">lwip/def.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h.html">lwip/mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="memp_8h.html">lwip/memp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sys_8h.html">lwip/sys.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="netif_8h.html">lwip/netif.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="tcp__priv_8h.html">lwip/priv/tcp_priv.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;<a class="el" href="tcpip_8h.html">lwip/tcpip.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacfcb0a2af918658ba0afe36499c65f47"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gacfcb0a2af918658ba0afe36499c65f47">pbuf_alloc</a> (<a class="el" href="group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> layer, u16_t length, <a class="el" href="group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> type)</td></tr>
<tr class="separator:gacfcb0a2af918658ba0afe36499c65f47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4caa46c6d560d9d0da2be845bc9c2fab"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga4caa46c6d560d9d0da2be845bc9c2fab">pbuf_alloc_reference</a> (void *payload, u16_t length, <a class="el" href="group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> type)</td></tr>
<tr class="separator:ga4caa46c6d560d9d0da2be845bc9c2fab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga90fa2bbf6ea4a263ee8f7b77c75683c2"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga90fa2bbf6ea4a263ee8f7b77c75683c2">pbuf_alloced_custom</a> (<a class="el" href="group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> l, u16_t length, <a class="el" href="group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> type, struct <a class="el" href="structpbuf__custom.html">pbuf_custom</a> *p, void *payload_mem, u16_t payload_mem_len)</td></tr>
<tr class="separator:ga90fa2bbf6ea4a263ee8f7b77c75683c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50abfe830a33a1a47a562febee66015d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga50abfe830a33a1a47a562febee66015d">pbuf_realloc</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, u16_t new_len)</td></tr>
<tr class="separator:ga50abfe830a33a1a47a562febee66015d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32dc14bd88dcafa25e627ab18e801815"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#a32dc14bd88dcafa25e627ab18e801815">pbuf_add_header</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, size_t header_size_increment)</td></tr>
<tr class="separator:a32dc14bd88dcafa25e627ab18e801815"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4ef8c5fbbd1447db04f8f73923e7dee"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#ad4ef8c5fbbd1447db04f8f73923e7dee">pbuf_add_header_force</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, size_t header_size_increment)</td></tr>
<tr class="separator:ad4ef8c5fbbd1447db04f8f73923e7dee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca0cd8b3f08fbb5e35bc91a663083cc1"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#aca0cd8b3f08fbb5e35bc91a663083cc1">pbuf_remove_header</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, size_t header_size_decrement)</td></tr>
<tr class="separator:aca0cd8b3f08fbb5e35bc91a663083cc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f81deff4a0e6e8e0ff161a7b9871449"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#a0f81deff4a0e6e8e0ff161a7b9871449">pbuf_header</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, s16_t header_size_increment)</td></tr>
<tr class="separator:a0f81deff4a0e6e8e0ff161a7b9871449"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0e64d6fbc423593461063da97da9ce6"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#ad0e64d6fbc423593461063da97da9ce6">pbuf_header_force</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, s16_t header_size_increment)</td></tr>
<tr class="separator:ad0e64d6fbc423593461063da97da9ce6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25a3b8edc783896b03819a966d00845e"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#a25a3b8edc783896b03819a966d00845e">pbuf_free_header</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *q, u16_t size)</td></tr>
<tr class="separator:a25a3b8edc783896b03819a966d00845e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0dd696fb4b6bc65e548944584f1738b"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:gab0dd696fb4b6bc65e548944584f1738b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5df7ac5ae59012fe9aeddba375a72190"><td class="memItemLeft" align="right" valign="top">u16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#a5df7ac5ae59012fe9aeddba375a72190">pbuf_clen</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:a5df7ac5ae59012fe9aeddba375a72190"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77f6bbd69e45e542014d9c547c7da74e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga77f6bbd69e45e542014d9c547c7da74e">pbuf_ref</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:ga77f6bbd69e45e542014d9c547c7da74e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82429084fe29015509c9b4a072707cd4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga82429084fe29015509c9b4a072707cd4">pbuf_cat</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *h, struct <a class="el" href="structpbuf.html">pbuf</a> *t)</td></tr>
<tr class="separator:ga82429084fe29015509c9b4a072707cd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga831c9a72bda1d3bd4c7b96f5a0e3b891"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga831c9a72bda1d3bd4c7b96f5a0e3b891">pbuf_chain</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *h, struct <a class="el" href="structpbuf.html">pbuf</a> *t)</td></tr>
<tr class="separator:ga831c9a72bda1d3bd4c7b96f5a0e3b891"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf3d29c4f43986b4cb5eb314d5b9729d"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#abf3d29c4f43986b4cb5eb314d5b9729d">pbuf_dechain</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:abf3d29c4f43986b4cb5eb314d5b9729d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba88511dee3df4b631fde691f421320d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gaba88511dee3df4b631fde691f421320d">pbuf_copy</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p_to, const struct <a class="el" href="structpbuf.html">pbuf</a> *p_from)</td></tr>
<tr class="separator:gaba88511dee3df4b631fde691f421320d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac2f1f58fd36042e82af46f5015720899"><td class="memItemLeft" align="right" valign="top">u16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gac2f1f58fd36042e82af46f5015720899">pbuf_copy_partial</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *buf, void *dataptr, u16_t len, u16_t offset)</td></tr>
<tr class="separator:gac2f1f58fd36042e82af46f5015720899"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad0357ae0be17b2aacd0c301cdc86fc39"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gad0357ae0be17b2aacd0c301cdc86fc39">pbuf_get_contiguous</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, void *buffer, size_t bufsize, u16_t len, u16_t offset)</td></tr>
<tr class="separator:gad0357ae0be17b2aacd0c301cdc86fc39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a961522d81f0327aaf4d4ee6d96c583"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga6a961522d81f0327aaf4d4ee6d96c583">pbuf_skip</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *in, u16_t in_offset, u16_t *out_offset)</td></tr>
<tr class="separator:ga6a961522d81f0327aaf4d4ee6d96c583"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad1e31e370271335b197272af2724ca85"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gad1e31e370271335b197272af2724ca85">pbuf_take</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *buf, const void *dataptr, u16_t len)</td></tr>
<tr class="separator:gad1e31e370271335b197272af2724ca85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae1cf2bf7454ff87ff377b0b2262f9b44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gae1cf2bf7454ff87ff377b0b2262f9b44">pbuf_take_at</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *buf, const void *dataptr, u16_t len, u16_t offset)</td></tr>
<tr class="separator:gae1cf2bf7454ff87ff377b0b2262f9b44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54ac7b116c6f53c704cbf74f35a8b35c"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga54ac7b116c6f53c704cbf74f35a8b35c">pbuf_coalesce</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, <a class="el" href="group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> layer)</td></tr>
<tr class="separator:ga54ac7b116c6f53c704cbf74f35a8b35c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafdb04fb0f37f0422fd44ec0fcec8ebd0"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gafdb04fb0f37f0422fd44ec0fcec8ebd0">pbuf_clone</a> (<a class="el" href="group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> layer, <a class="el" href="group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> type, struct <a class="el" href="structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:gafdb04fb0f37f0422fd44ec0fcec8ebd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d803d9945bffb7ad97743f2fa503da6"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga6d803d9945bffb7ad97743f2fa503da6">pbuf_get_at</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, u16_t offset)</td></tr>
<tr class="separator:ga6d803d9945bffb7ad97743f2fa503da6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga839f342803b0cf89049744124c5a98ad"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga839f342803b0cf89049744124c5a98ad">pbuf_try_get_at</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, u16_t offset)</td></tr>
<tr class="separator:ga839f342803b0cf89049744124c5a98ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf76863707dc02993eae116574b1ea03f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#gaf76863707dc02993eae116574b1ea03f">pbuf_put_at</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, u16_t offset, u8_t data)</td></tr>
<tr class="separator:gaf76863707dc02993eae116574b1ea03f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2170ccbbb13238380dbb203ee1b85974"><td class="memItemLeft" align="right" valign="top">u16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga2170ccbbb13238380dbb203ee1b85974">pbuf_memcmp</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, u16_t offset, const void *s2, u16_t n)</td></tr>
<tr class="separator:ga2170ccbbb13238380dbb203ee1b85974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga18c164a6e4a24d89ea9eb7571a886448"><td class="memItemLeft" align="right" valign="top">u16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pbuf.html#ga18c164a6e4a24d89ea9eb7571a886448">pbuf_memfind</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, const void *<a class="el" href="structmem.html">mem</a>, u16_t mem_len, u16_t start_offset)</td></tr>
<tr class="separator:ga18c164a6e4a24d89ea9eb7571a886448"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ba3f7b705309ceadb147692fd5a1c7d"><td class="memItemLeft" align="right" valign="top">u16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#a9ba3f7b705309ceadb147692fd5a1c7d">pbuf_strstr</a> (const struct <a class="el" href="structpbuf.html">pbuf</a> *p, const char *substr)</td></tr>
<tr class="separator:a9ba3f7b705309ceadb147692fd5a1c7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Packet buffer management </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a32dc14bd88dcafa25e627ab18e801815"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32dc14bd88dcafa25e627ab18e801815">&#9670;&nbsp;</a></span>pbuf_add_header()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t pbuf_add_header </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>header_size_increment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adjusts the payload pointer to reveal headers in the payload.</p>
<p>Adjusts the -&gt;payload pointer so that space for a header appears in the pbuf payload.</p>
<p>The -&gt;payload, -&gt;tot_len and -&gt;len fields are adjusted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to change the header size. </td></tr>
    <tr><td class="paramname">header_size_increment</td><td>Number of bytes to increment header size which increases the size of the pbuf. New space is on the front. If header_size_increment is 0, this function does nothing and returns successful.</td></tr>
  </table>
  </dd>
</dl>
<p>PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer.</p>
<dl class="section return"><dt>Returns</dt><dd>non-zero on failure, zero on success. </dd></dl>

</div>
</div>
<a id="ad4ef8c5fbbd1447db04f8f73923e7dee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4ef8c5fbbd1447db04f8f73923e7dee">&#9670;&nbsp;</a></span>pbuf_add_header_force()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t pbuf_add_header_force </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>header_size_increment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Same as <a class="el" href="pbuf_8h.html#a32dc14bd88dcafa25e627ab18e801815">pbuf_add_header</a> but does not check if 'header_size &gt; 0' is allowed. This is used internally only, to allow PBUF_REF for RX. </p>

</div>
</div>
<a id="a5df7ac5ae59012fe9aeddba375a72190"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5df7ac5ae59012fe9aeddba375a72190">&#9670;&nbsp;</a></span>pbuf_clen()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16_t pbuf_clen </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Count number of pbufs in a chain</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>first pbuf of chain </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of pbufs in a chain </dd></dl>

</div>
</div>
<a id="abf3d29c4f43986b4cb5eb314d5b9729d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf3d29c4f43986b4cb5eb314d5b9729d">&#9670;&nbsp;</a></span>pbuf_dechain()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structpbuf.html">pbuf</a>* pbuf_dechain </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Dechains the first pbuf from its succeeding pbufs in the chain.</p>
<p>Makes p-&gt;tot_len field equal to p-&gt;len. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to dechain </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>remainder of the pbuf chain, or NULL if it was de-allocated. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>May not be called on a packet queue. </dd></dl>

</div>
</div>
<a id="a25a3b8edc783896b03819a966d00845e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25a3b8edc783896b03819a966d00845e">&#9670;&nbsp;</a></span>pbuf_free_header()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structpbuf.html">pbuf</a>* pbuf_free_header </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Similar to pbuf_header(-size) but de-refs header pbufs for (size &gt;= p-&gt;len)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>pbufs to operate on </td></tr>
    <tr><td class="paramname">size</td><td>The number of bytes to remove from the beginning of the pbuf list. While size &gt;= p-&gt;len, pbufs are freed. ATTENTION: this is the opposite direction as <a class="el" href="pbuf_8h.html#aaa17c1951cf2d207b6adfd3947d91f00">pbuf_header</a>, but takes an u16_t not s16_t! </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new head pbuf </dd></dl>

</div>
</div>
<a id="a0f81deff4a0e6e8e0ff161a7b9871449"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f81deff4a0e6e8e0ff161a7b9871449">&#9670;&nbsp;</a></span>pbuf_header()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t pbuf_header </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s16_t&#160;</td>
          <td class="paramname"><em>header_size_increment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adjusts the payload pointer to hide or reveal headers in the payload.</p>
<p>Adjusts the -&gt;payload pointer so that space for a header (dis)appears in the pbuf payload.</p>
<p>The -&gt;payload, -&gt;tot_len and -&gt;len fields are adjusted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to change the header size. </td></tr>
    <tr><td class="paramname">header_size_increment</td><td>Number of bytes to increment header size which increases the size of the pbuf. New space is on the front. (Using a negative value decreases the header size.) If header_size_increment is 0, this function does nothing and returns successful.</td></tr>
  </table>
  </dd>
</dl>
<p>PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer. </p><dl class="section return"><dt>Returns</dt><dd>non-zero on failure, zero on success. </dd></dl>

</div>
</div>
<a id="ad0e64d6fbc423593461063da97da9ce6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad0e64d6fbc423593461063da97da9ce6">&#9670;&nbsp;</a></span>pbuf_header_force()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t pbuf_header_force </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">s16_t&#160;</td>
          <td class="paramname"><em>header_size_increment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Same as pbuf_header but does not check if 'header_size &gt; 0' is allowed. This is used internally only, to allow PBUF_REF for RX. </p>

</div>
</div>
<a id="aca0cd8b3f08fbb5e35bc91a663083cc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca0cd8b3f08fbb5e35bc91a663083cc1">&#9670;&nbsp;</a></span>pbuf_remove_header()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t pbuf_remove_header </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>header_size_decrement</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adjusts the payload pointer to hide headers in the payload.</p>
<p>Adjusts the -&gt;payload pointer so that space for a header disappears in the pbuf payload.</p>
<p>The -&gt;payload, -&gt;tot_len and -&gt;len fields are adjusted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to change the header size. </td></tr>
    <tr><td class="paramname">header_size_decrement</td><td>Number of bytes to decrement header size which decreases the size of the pbuf. If header_size_decrement is 0, this function does nothing and returns successful. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>non-zero on failure, zero on success. </dd></dl>

</div>
</div>
<a id="a9ba3f7b705309ceadb147692fd5a1c7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ba3f7b705309ceadb147692fd5a1c7d">&#9670;&nbsp;</a></span>pbuf_strstr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16_t pbuf_strstr </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>substr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find occurrence of substr with length substr_len in pbuf p, start at offset start_offset WARNING: in contrast to strstr(), this one does not stop at the first \0 in the pbuf/source string!</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' </td></tr>
    <tr><td class="paramname">substr</td><td>string to search for in p, maximum length is 0xFFFE </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0xFFFF if substr was not found in p or the index where it was found </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><a class="el" href="pbuf_8c.html">pbuf.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
